package com.guodexian.xiaomi.dao;

import com.guodexian.xiaomi.entity.User;
import com.guodexian.xiaomi.tx.TransactionManager;

/**
 * 类说明：  <br>
 *
 * @author 南阳德刚<br>
 * 2024-12-30 14:41<br>
 * @since 1.0 <br>
 * 培养IT高薪技术人才的摇篮---北京学佳澳。<br>
 * 点击<a href="http://www.xuejiaao.com/images/qrcode.jpg">学佳澳教育</a>关注公共号,有惊喜(⊙o⊙)<br>
 */
public class Sql2oUserDaoImpl implements UserDao {
    @Override
    public User findUserByName(String username) {
        return TransactionManager.getConnection().createQuery("select * from user where username=:username")
                 .addParameter("username", username)
                .executeAndFetchFirst(User.class)
                ;
    }
}